package com.bdzl.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Health entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "health", catalog = "bdzl")
public class Health  {

	// Fields

	private Integer id;
	private Clause clause;//条款ID
	private Integer waitDay;//等待期(90天)
	private String renewal;//保障续保说明
	private Set<HealthPlan> healthPlans = new HashSet<HealthPlan>(0);
	private Set<HealthInformation> healthInformations = new HashSet<HealthInformation>(
			0);

	// Constructors

	/** default constructor */
	public Health() {
	}

	/** full constructor */
	public Health(Clause clause, Integer waitDay, String renewal,
			Set<HealthPlan> healthPlans,
			Set<HealthInformation> healthInformations) {
		this.clause = clause;
		this.waitDay = waitDay;
		this.renewal = renewal;
		this.healthPlans = healthPlans;
		this.healthInformations = healthInformations;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "clause_id")
	public Clause getClause() {
		return this.clause;
	}

	public void setClause(Clause clause) {
		this.clause = clause;
	}

	@Column(name = "wait_day")
	public Integer getWaitDay() {
		return this.waitDay;
	}

	public void setWaitDay(Integer waitDay) {
		this.waitDay = waitDay;
	}

	@Column(name = "renewal")
	public String getRenewal() {
		return this.renewal;
	}

	public void setRenewal(String renewal) {
		this.renewal = renewal;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "health")
	public Set<HealthPlan> getHealthPlans() {
		return this.healthPlans;
	}

	public void setHealthPlans(Set<HealthPlan> healthPlans) {
		this.healthPlans = healthPlans;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "health")
	public Set<HealthInformation> getHealthInformations() {
		return this.healthInformations;
	}

	public void setHealthInformations(Set<HealthInformation> healthInformations) {
		this.healthInformations = healthInformations;
	}

}